package test0.dao.proxy;


import test0.dao.dbc.DatabaseConnection;
import test0.dao.idao.IUserDAO;
import test0.dao.impl.UserDAOImpl;
import test0.dao.vo.User;

public class UserDAOProxy implements IUserDAO {
	private DatabaseConnection dbc=null;
	private IUserDAO dao=null;
	
	public UserDAOProxy() {
		try {
			this.dbc = new DatabaseConnection();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		this.dao=new UserDAOImpl(this.dbc.getConnection());
	}
	
	@Override
	public boolean findLogin(User user) throws Exception {
		
		// TODO Auto-generated method stub
		boolean flag=false;
		try {
			flag = this.dao.findLogin(user);
		} catch (Exception e) {
			throw e;
		} finally {
			this.dbc.close();
		}
		return flag;
	}

}
